<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>首页模板 可视化修改 <%=zych_tempdir%></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/js/layer/layer.js"></script>
<link rel="stylesheet" type="text/css" id="css" href="images/style.css">
<style>
.sel{padding:3px;line-height:20px;border:1px #CCC solid;font-family:'微软雅黑'; cursor:pointer}
.pbox{width:1010px;height:auto;position:absolute;left:50%;margin-left:-505px;}
.pbox .box{background:rgba(255, 255, 255, 0.1)!important;filter:Alpha(opacity=10); background:#fff;overflow:hidden; position:relative;border:2px #09F solid;}
.pbox .box a.dis{width:200px;padding:10px 0px;position:absolute;left:50%; top:50%;margin-left:-100px;margin-top:-25px;display:none;background:#09F;text-align:center;color:#FFF;font-size:24px;border-top-left-radius:8px;border-top-right-radius:8px;border-bottom-left-radius:8px;border-bottom-right-radius:8px;transition:.2s ease all;-webkit-transition:.2s ease all;-moz-transition:.2s ease all}
.pbox .box:hover{background:rgba(255, 255, 255, 0.8)!important;filter:Alpha(opacity=80); background:#fff; overflow:hidden;border:2px #F00 solid}
.pbox .box:hover a.dis{display:block}
.pbox .box a.dis span{font-size:24px}
.bottom{width:100%;position:fixed;height:70px; bottom:0px;background:rgba(255, 150, 30, 0.7)!important;filter:Alpha(opacity=70); background:#f3981c; text-align:center}
.bottom .bnt{ width:200px; height:50px; font-size:30px; margin:10px;cursor:pointer}
</style>
</head>
<body>
<%if request.querystring("action")="inSave" then
    Set ASM = server.CreateObject("Adod" & "b.St" & "ream")
    ASM.Type = 2
    ASM.mode = 3
    ASM.charset = "utf-8"
    ASM.Open
    ASM.WriteText "<" & "%" & vbCrLf
	ASM.WriteText "Const inaboutid = "&Chr(34)&ReplaceConstChar(Trim(request("inaboutid")))&Chr(34)&"'首页单页ID"&vbCrLf
    ASM.WriteText "Const inporid = "&Chr(34)&ReplaceConstChar(Trim(request("inporid")))&Chr(34)&"'首页产品ID"&vbCrLf
	ASM.WriteText "Const incase = "&Chr(34)&ReplaceConstChar(Trim(request("incase")))&Chr(34)&"'首页图片幻灯"&vbCrLf
	ASM.WriteText "Const intxtid = "&Chr(34)&ReplaceConstChar(Trim(request("intxtid")))&Chr(34)&"'首页文章列表"&vbCrLf
    ASM.WriteText "%" & ">"
    ASM.SaveToFile Server.mappath(".."&zych_templatedir&"inc/inid.asp"), 2
    ASM.flush
    ASM.Close
    Set ASM = Nothing
    response.Write "<script language=""javascript"">alert('系统附加参数生成成功');location.href='admin_intemplate.asp';</script>"
end if%>

<form name="ConstForm" method="post" action="?Action=inSave">
<div class="pbox">
<div class="box" style="width:390px;height:90px;margin-top:35px;"><a class="dis" href="admin_xtsz.asp?action=admin" title="点击管理导航">修改LOGO</a></div>
<div class="box" style="height:50px;margin-top:5px;"><a class="dis" href="Admin_Class.asp" title="点击管理导航">管理导航</a></div>
<div class="box" style="height:370px;margin-top:8px;"><a class="dis" id="flash" href="javascript:" title="点击管理导航">管理幻灯</a></div>

<div class="box" style="width:262px;height:245px;float:left;margin-top:8px;"><a class="dis" id="aboutimg" href="javascript:" title="点击管理导航">修改图片</a></div>
<div class="box" style="width:415px;height:245px;float:left;margin-top:8px;margin-left:5px""><a class="dis"><span>选择频道</span> <%selectlist "inaboutid","zych_type","sortname","sortid",inaboutid, 0," and sorttype=1 order by px_id","请选择单页",0,""%></a></div>

<div class="box" style="width:308px;height:245px;float:right;margin-top:8px;margin-left:5px;"><a class="dis" id="video" href="javascript:"><span>修改视频</span></a></div>

<div style="clear:both"></div>
<div class="box" style="height:260px;margin-top:15px;clear:both">
<a class="dis"><span>选择频道</span> <% selectlist "inporid","zych_type","sortname","topsortid",inporid, 0," and ParentID=0 and sorttype<>1 order by px_id","请选择频道",0,""%></a></div>

<div class="box" style="width:540px;height:355px;float:left;margin-top:12px;">
<a class="dis"><span>选择频道</span> <%selectlist "incase","zych_type","sortname","sortid",incase, 0," and ParentID=0 and sorttype<>1 order by px_id","请选择频道",0,""%></a></div>

<div class="box" style="width:450px;height:355px;float:right;margin-top:12px;">
<a class="dis"><span>选择频道</span> <%selectlist "intxtid","zych_type","sortname","topsortid",intxtid, 0," and ParentID=0 and sorttype<>1 order by px_id","请选择频道",0,""%></a></div>

</div>
<div class="bottom"> <input class="bnt" type="submit" value="保存修改" /></div>
</form>
<iframe src="../" id="iframepage" name="iframepage" frameBorder=0 scrolling=no width="100%" onLoad="reinitIframeEND();"  ></iframe>
<script type="text/javascript" language="javascript">   
function reinitIframe(){
var iframe = document.getElementById("iframepage");
try{
    var bHeight = iframe.contentWindow.document.body.scrollHeight;
    var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
    var height = Math.max(bHeight, dHeight);
    iframe.height = height;
}catch (ex){}
}
var timer1 = window.setInterval("reinitIframe()", 500); //定时开始
function reinitIframeEND(){
var iframe = document.getElementById("iframepage");
try{
    var bHeight = iframe.contentWindow.document.body.scrollHeight;
    var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
    var height = Math.max(bHeight, dHeight);
    iframe.height = height;
}catch (ex){}
// 停止定时
window.clearInterval(timer1);
}
$(document).ready(function(){//弹出购买窗口
	$('#video').on('click', function(){
			layer.open({title: "修改视频幻灯",type:2,area: ['900px', '300px'],fix: true, //不固定
			maxmin:true,content: 'admin_xtsz.asp?action=video'
			});
	});
	
	$('#flash').on('click', function(){
			layer.open({
			title: "修改首页幻灯",
			type:2,
			area: ['900px', '500px'],
			fix: true, //不固定
			maxmin: true,
			//content: 'html内容'
			content: 'admin_indexflash.asp?action=admin'
			});
	});
	
	$('#aboutimg').on('click', function(){
			layer.open({
			title: "修改关于我们广告图片",
			type:2,
			area: ['900px', '500px'],
			fix: true, //不固定
			maxmin: true,
			//content: 'html内容'
			content: 'admin_ad.asp?action=admin'
			});
	});

});
</script>
<%
function selectlist(selname,tablename,fieldtext,fieldvalue,selected, parentid,strorder,toptext,sortid,events)
	echo "<select class=sel name="""&selname&""" id="""&selname&""" "&events&">"&vbcr&"<option value=""0"">"&toptext&"</option>"&vbcr 
	if sortid="0" or sortid="" then
	makeoption tablename,fieldtext,fieldvalue,selected,strorder,parentid
	else
	makeoption_e tablename,fieldtext,fieldvalue,selected,strorder,parentid,sortid
	end if
	echo "</select>"&vbcr
end function
function makeoption(tablename,fieldtext,fieldvalue,selected,strorder,parentid)
	dim rs ,sel
	sel=""
	set rs =conn.execute ("select ["&fieldvalue&"],["&fieldtext&"],parentid,sortlevel,(select count(*) from zych_type where parentid=t.sortid) as c from "&tablename&" as t where parentid="&parentid&" "&strorder,"r1")		
	do while not rs.eof	
		if cstr(selected)=cstr(rs(0)) then sel = "selected=""selected""" else sel="" end if
		echo "<option value="""&rs(0)&""" "&sel&">"&getlevel_(rs(3))&rs(1)&"</option>"&vbcrlf
		if rs(4)>0 then 
			makeoption = makeoption&makeoption(tablename,fieldtext,fieldvalue,selected,strorder,rs(0))
		end if
		rs.movenext
	loop
	rs.close
	set rs=nothing
end function

function makeoption_e(tablename,fieldtext,fieldvalue,selected,strorder,parentid,sortid)
	dim rs ,sel
	sel=""
	set rs =conn.execute ("select ["&fieldvalue&"],["&fieldtext&"],parentid,sortlevel,(select count(*) from zych_type where parentid=t.sortid) as c from "&tablename&" as t where parentid="&parentid&" "&strorder,"r1")		
	do while not rs.eof	
		if cstr(selected)=cstr(rs(0)) then sel = "selected=""selected""" else sel="" end if
		if sortid=rs(0) then
		echo "<option value="""&rs(0)&""" disabled='disabled'>"&getlevel_(rs(3))&rs(1)&"</option>"&vbcr
		else
		echo "<option value="""&rs(0)&""" "&sel&">"&getlevel_(rs(3))&rs(1)&"</option>"&vbcr
		end if
		if rs(4)>0 then 
			makeoption_e = makeoption_e&makeoption_e(tablename,fieldtext,fieldvalue,selected,strorder,rs(0),sortid)
		end if
		rs.movenext
	loop
	rs.close:set rs=nothing
end function

Function ReplaceConstChar(strChar)
    If strChar = "" Or IsNull(strChar) Then
        ReplaceConstChar = ""
        Exit Function
    End If
    Dim strBadChar, arrBadChar, tempChar, i
    strBadChar = "+,',%,^,&,?,(,),<,>,[,],{,},;,:,"&Chr(34)&","&Chr(0)&",--"
    arrBadChar = Split(strBadChar, ",")
    tempChar = strChar
    For i = 0 To UBound(arrBadChar)
        tempChar = Replace(tempChar, arrBadChar(i), "")
    Next
    tempChar = Replace(tempChar, "@@", "@")
    ReplaceConstChar = tempChar
End Function %>
</body>
</html>
